package dialogs;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.example.administrator.newxlmedical.R;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import custom.MyDialog;

/**
 * Created by Administrator on 2018/5/17.
 */

public class ComboSetDeleteDialog extends MyDialog {

    @BindView(R.id.tv_combo_set_goods)
    TextView tvGoods;
    @BindView(R.id.bt_combo_set_cancel)
    Button btCancel;
    @BindView(R.id.bt_combo_set_sure)
    Button btSure;
    private ComboSetDeleteInterface listener;
    private String goods;

    public ComboSetDeleteDialog(@NonNull Context context, int themeResId, String goods, ComboSetDeleteInterface listener) {
        super(context, themeResId);
        this.listener = listener;
        this.goods = goods;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_combo_set_delete);
        ButterKnife.bind(this);
        tvGoods.setText(goods);
    }

    @OnClick({R.id.bt_combo_set_cancel, R.id.bt_combo_set_sure})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.bt_combo_set_cancel:
                dismiss();
                break;
            case R.id.bt_combo_set_sure:
                listener.sure();
                dismiss();
                break;
        }
    }

    public interface ComboSetDeleteInterface {
        void sure();
    }
}
